package com.mypack.dao;

import java.util.List;

import com.mypack.dao.helper.DaoSupport;
import com.mypack.domain.Email;

public class EmailDao extends DaoSupport<Email> {
	private static EmailDao dao = new EmailDao();
	
	/**
	 * static factory
	 * get dao instance
	 */
	public static EmailDao get() {
		return dao;
	}
	
	public List<Email> findAll() {
		return getEM().createQuery("select from Email order by date desc").setMaxResults(100).getResultList();
	}
}
